package com.example.demo.common.vo;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 返回结果集
 * 
 * @author Administrator
 *
 */
public class ResultVo {
	// 结果编码, 默认0是正常, 因为操作成功只有一种状态，失败却有多种原因
	private int code = 0;
	private String message;
	private Object data;

	public ResultVo() {
	}

	public ResultVo(int code) {
		this.code = code;
	}

	public ResultVo(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public ResultVo(int code, String message, Object data) {
		this.code = code;
		this.message = message;
		this.data = data;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
	}
}
